@import './variables.scss';

// 全局样式重置
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
  font-size: $font-size-base;
  color: $text-primary;
  background-color: $bg-secondary;
  line-height: 1.6;
}

// 工具类
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.flex { display: flex; }
.flex-center { 
  display: flex; 
  align-items: center; 
  justify-content: center; 
}
.flex-between { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
}
.flex-column { 
  display: flex; 
  flex-direction: column; 
}

.mt-xs { margin-top: $spacing-xs; }
.mt-sm { margin-top: $spacing-sm; }
.mt-md { margin-top: $spacing-md; }
.mt-lg { margin-top: $spacing-lg; }
.mt-xl { margin-top: $spacing-xl; }

.mb-xs { margin-bottom: $spacing-xs; }
.mb-sm { margin-bottom: $spacing-sm; }
.mb-md { margin-bottom: $spacing-md; }
.mb-lg { margin-bottom: $spacing-lg; }
.mb-xl { margin-bottom: $spacing-xl; }

.ml-xs { margin-left: $spacing-xs; }
.ml-sm { margin-left: $spacing-sm; }
.ml-md { margin-left: $spacing-md; }
.ml-lg { margin-left: $spacing-lg; }
.ml-xl { margin-left: $spacing-xl; }

.mr-xs { margin-right: $spacing-xs; }
.mr-sm { margin-right: $spacing-sm; }
.mr-md { margin-right: $spacing-md; }
.mr-lg { margin-right: $spacing-lg; }
.mr-xl { margin-right: $spacing-xl; }

.p-xs { padding: $spacing-xs; }
.p-sm { padding: $spacing-sm; }
.p-md { padding: $spacing-md; }
.p-lg { padding: $spacing-lg; }
.p-xl { padding: $spacing-xl; }

// 卡片样式
.card {
  background: $bg-primary;
  border-radius: $border-radius-large;
  box-shadow: $shadow-base;
  padding: $spacing-lg;
  margin-bottom: $spacing-md;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: $spacing-md;
  padding-bottom: $spacing-sm;
  border-bottom: 1px solid $border-light;
  
  .title {
    font-size: $font-size-lg;
    font-weight: $font-weight-medium;
    color: $text-primary;
  }
}

// 页面容器
.page-container {
  padding: $spacing-lg;
  background: $bg-secondary;
  min-height: calc(100vh - 60px);
}

// 搜索表单
.search-form {
  background: $bg-primary;
  border-radius: $border-radius-large;
  padding: $spacing-lg;
  margin-bottom: $spacing-md;
  box-shadow: $shadow-base;
  
  .el-form {
    .el-form-item {
      margin-bottom: $spacing-md;
    }
  }
}

// 操作按钮组
.action-buttons {
  display: flex;
  gap: $spacing-sm;
  margin-bottom: $spacing-md;
  flex-wrap: wrap;
}

// 表格容器
.table-container {
  background: $bg-primary;
  border-radius: $border-radius-large;
  padding: $spacing-lg;
  box-shadow: $shadow-base;
}

// 统计卡片
.stat-card {
  background: linear-gradient(135deg, $primary-color, lighten($primary-color, 10%));
  color: white;
  border-radius: $border-radius-large;
  padding: $spacing-lg;
  text-align: center;
  box-shadow: $shadow-base;
  transition: $transition-base;
  
  &:hover {
    transform: translateY(-2px);
    box-shadow: $shadow-dark;
  }
  
  .stat-icon {
    font-size: 2.5rem;
    margin-bottom: $spacing-sm;
    opacity: 0.8;
  }
  
  .stat-number {
    font-size: 2rem;
    font-weight: $font-weight-bold;
    margin-bottom: $spacing-xs;
  }
  
  .stat-label {
    font-size: $font-size-sm;
    opacity: 0.9;
  }
}

// 加载状态
.loading-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: $text-secondary;
}

// 空状态
.empty-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: $text-secondary;
  
  .empty-icon {
    font-size: 3rem;
    margin-bottom: $spacing-md;
    opacity: 0.5;
  }
  
  .empty-text {
    font-size: $font-size-lg;
  }
}

// 响应式设计
@media (max-width: 768px) {
  .page-container {
    padding: $spacing-md;
  }
  
  .card {
    padding: $spacing-md;
  }
  
  .action-buttons {
    flex-direction: column;
    
    .el-button {
      width: 100%;
    }
  }
  
  .search-form {
    .el-form {
      .el-form-item {
        margin-bottom: $spacing-sm;
      }
    }
  }
}

// 深色主题
.dark-theme {
  background-color: $dark-secondary;
  color: $dark-light;
  
  .card {
    background: $dark-primary;
    color: $dark-light;
  }
  
  .search-form {
    background: $dark-primary;
  }
  
  .table-container {
    background: $dark-primary;
  }
}
